import request from '@/utils/request'

/**
 * 获取所有权限点
 * @returns 
 */
export function getPermisson() {
    return request({
        url:"/sys/permission"
    })
}

/**
 * 添加权限点
 * @param {*} data 
 * @returns 
 */
export function addPermisson(data) {
    return request({
        url: "/sys/permission",
        method: "post",
        data
    })
}

/**
 * 根据id获取权限信息
 * @param {*} id 
 * @returns 
 */
export function getPermi(id) {
    return request({
        url:`/sys/permission/${id}`
    })    
}

/**
 * 修改权限点
 * @param {*} data 
 * @returns 
 */
export function  setPermi(data) {
    return request({
        url: `/sys/permission/${data.id}`,
        method: "put",
        data
    })
}

/**
 * 删除权限点
 * @param {*} id 
 * @returns 
 */
export function delPermi(id) {
    return request({
        url: `/sys/permission/${id}`,
        method:"delete"
    })
}